#include <iostream>
#include "singleton.h"

using namespace std;

class SObject
{
    friend class singleton<SObject>;

    SObject(const SObject&);
    SObject& operator= (const SObject&);

    SObject()
    {

    }
public:
    void print()
    {
        cout << "this = " << this << endl;
    }
};

void singleton_test()
{
    SObject* s = singleton<SObject>::GetInstance();
    SObject* s1 = singleton<SObject>::GetInstance();
    SObject* s2 = singleton<SObject>::GetInstance();

    s->print();
    s1->print();
    s2->print();
}
